import VueRouter from 'vue-router'

// 导入对应的路由组件
import home from './components/tab/home.vue'
import member from './components/tab/member.vue'
import shopping from './components/tab/shopping.vue'
import search from './components/tab/search.vue'
import newlist from './components/new/newlist.vue'
import newinfo from './components/new/newinfo.vue'
import photolist from './components/photo/photolist.vue'
import photoinfo from './components/photo/photoinfo.vue'
import shopplist from './components/shopping/shopplist.vue'
import shoppinfo from './components/shopping/shoppinfo.vue'
import shopptuwen from './components/shopping/shopptuwen.vue'
import shopppinglun from './components/shopping/shopppinglun.vue'

// 3. 创建路由对象
var router = new VueRouter({
  routes: [ // 配置路由规则
    { path: '/', redirect: '/home' },
    { path: '/home', component: home},
    { path:'/member', component:member},
    { path:'/shopping', component:shopping},
    { path:'/search', component:search},
    { path:'/home/newlist',component:newlist},
    { path:'/home/newinfo/:id',component:newinfo},
    { path:'/home/photolist',component:photolist},
    { path:'/home/photoinfo/:id',component:photoinfo},
    { path:'/home/shopplist',component:shopplist},
    { path:'/home/shoppinfo/:id',component:shoppinfo,name:'shoppinfo'},
    { path:'/home/shopptuwen/:id',component:shopptuwen,name:'shopptuwen'},
    { path:'/home/shopppinglun/:id',component:shopppinglun,name:'shopppinglun'}
  ]
})

// 把路由对象暴露出去
export default router